﻿using SqlSugar;
using EasyAdmin.Domain.Shared.Enums;
using EasyCore.Domain.Entities;

namespace EasyAdmin.Domain.Entities.Systems
{
    /// <summary>
    /// 组织机构
    /// </summary>
    [SugarTable("sys_org")]
    public class SysOrg : FullAuditedEntity
    {
        /// <summary>
        /// 唯一标识
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, IsNullable = false, ColumnDescription = "唯一标识")]
        public long Id { get; set; }

        /// <summary>
        /// 父机构唯一标识
        /// </summary>   
        [SugarColumn(IsNullable = false, ColumnDescription = "父菜单唯一标识")]
        public long ParentId { get; set; }

        /// <summary>
        /// 机构级别
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "机构级别")]
        public int Level { get; set; }

        /// <summary>
        /// 机构编码
        /// </summary>
        [SugarColumn(IsNullable = false,ColumnDescription = "机构编码",Length = 200)]
        public string OrgCode { get; set; }

        /// <summary>
        /// 同级编码
        /// </summary>
        public int DeptCode { get; set; }

        /// <summary>
        /// 组织名称
        /// </summary>
        [SugarColumn(IsNullable = false,ColumnDescription = "组织名称",Length = 50)]
        public string Name { get; set; }

        /// <summary>
        /// 组织全称
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "组织全称", Length = 150)]
        public string FullName { get; set; }

        /// <summary>
        /// 机构类型
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "机构类型", ColumnDataType = "int")]
        public OrgType OrgType { get; set; }

        /// <summary>
        /// 统一社会信用代码
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "统一社会信用代码", Length = 30)]
        public string CreditCode { get; set; }

        /// <summary>
        /// 联系人
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "联系人", Length = 20)]
        public string Contacts { get; set; }

        /// <summary>
        /// 联系电话
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "联系电话", Length = 11)]
        public string Telephone { get; set; }

        /// <summary>
        /// 联系地址
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "联系地址", Length = 200)]
        public string Address { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "备注", ColumnDataType ="TEXT")]
        public string Notes { get; set; }

        /// <summary>
        /// 是否禁用
        /// </summary>
        [SugarColumn(IsNullable = false,ColumnDescription = "是否禁用")]
        public bool IsDisabled { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "排序")]
        public int OrderSort { get; set; }
    }
}
